<template>
  <div>
    <div id="zong">
      <div
        v-for="(name, i) in nei"
        @click="dian(i)"
        :class="{ active: index == i }"
      >
        {{ name }}
      </div>
      <div>筛选</div>
    </div>
  </div>
</template>
<script>
export default {
  name: "fenlei",
  data() {
    return {
      nei: ["综合排行", "练车近", "学费低", "评价好"],
      arr: [10, 8, 4, 1],
      index: 0,
    };
  },
  methods: {
    dian(i) {
       this.$emit("biao",this.arr[i]);
      return (this.index = i);
 
    },
  },
};
</script>
<style scoped>
#zong {
  width: 100vw;
  height: 6vh;
  display: flex;
  justify-content: space-around;
  font-size: 3.5vw;
  line-height: 6vh;
}
.active {
  color: blue;
}
</style>
